import Vue from 'vue'
import Router from 'vue-router'

import login from 'components/login/login.vue'
import goods from 'components/goods/goods.vue'
import addgoods from 'components/goods/addgoods.vue'
import order from 'components/order/order.vue'
import shop from 'components/shop/shop.vue'

import caiwu from 'components/shop/caiwu.vue'
import coupon from 'components/shop/coupon.vue'
import category from 'components/shop/category.vue'
import desk from 'components/shop/desk.vue'
import adddesk from 'components/shop/adddesk.vue'
import peisong from 'components/shop/peisong.vue'
import shopsetting from 'components/shop/shopSetting.vue'
import address from 'components/shop/address.vue'
import addcoupon from 'components/shop/addcoupon.vue'

import goodsitem from 'components/goods/goodsitem.vue'

import orderitem from 'components/order/orderitem.vue'
import orderitem1 from 'components/order/orderitem1.vue'
import orderitem2 from 'components/order/orderitem2.vue'
import orderitem3 from 'components/order/orderitem3.vue'
import orderitem4 from 'components/order/orderitem4.vue'
import orderdetail from 'components/order/orderdetail.vue'

import diancan from 'components/diancan/diancan.vue'
import dcitem from 'components/diancan/dcitem.vue'
import dcitem2 from 'components/diancan/dcitem2.vue'

import yuding from 'components/yuding/yuding.vue'
import yditem from 'components/yuding/yditem.vue'
import yditem2 from 'components/yuding/yditem2.vue'
import yddetail from 'components/yuding/yddetail.vue'

Vue.use(Router)

export default new Router({
  routes: [
    { path: '/', redirect: '/order' },//设置默认路由
    {
      path: '/login',
      name: 'login',
      component: login
     },
    {
      path: '/goods',//商品
      component: goods,
      // redirect: '/goods/item/0000',
      // children:[
      //     { path: '/goods/item/:id', component: goodsitem}
      // ]
    },
    {
      path: '/addgoods/:id',//添加商品
      component: addgoods,
    },
    {
      path: '/order',//订单
      component: order,
      redirect: '/order/item/1',
      children:[
          {path: '/order/item/:id', component: orderitem},
          {path: '/order/item1/:id', component: orderitem1},
          {path: '/order/item2/:id', component: orderitem2},
          {path: '/order/item3/:id', component: orderitem3},
          {path: '/order/item4/:id', component: orderitem4}
      ]
    },
    {
      path: '/yd',//预定
      component: yuding,
      redirect: '/yd/item/1',
      children:[
          {path: '/yd/item/:id', component: yditem},
          {path: '/yd/item2/:id', component: yditem2}
      ]
    },
    {
      path: '/dc',//点餐
      component: diancan,
      redirect: '/dc/item/1',
      children:[
          {path: '/dc/item/:id', component: dcitem},
          {path: '/dc/item2/:id', component: dcitem2}
      ]
    },
    {
      path: '/orderdetail/:id',//添加商品
      component: orderdetail,
    },
    {
      path: '/yddetail/:id/:status',//预定订单详情
      component: yddetail,
    },
    {
      path: '/shop',//商铺
      component: shop
    },
    {
      path: '/shopsetting',//店铺设置
      component: shopsetting
    },
    {
      path: '/address',//地址
      component: address
    },
    {
      path: '/coupon',//优惠券
      component: coupon
    },
    {
      path: '/category',//商品分类
      component: category
    },
    {
      path: '/desk',//餐桌分类
      component: desk
    },
    {
      path: '/adddesk/:id',//餐桌分类
      component: adddesk
    },
    {
      path: '/caiwu',//财务管理
      component: caiwu
    },
    {
      path: '/peisong',//配送费管理
      component: peisong
    },
    {
      path: '/addcoupon/:id',//添加优惠券
      component: addcoupon,
    },
  ]
})
